Field of the Invention
The present invention relates to computer programming. More specifically, the present invention relates to a method and an apparatus for encapsulating and managing diagnostic information that is produced by a computer program that analyzes the source code of computer programs.
Related Art
Computer programs are typically written in source code and then compiled into object code for execution on a specific platform. This compilation process analyzes the source code to find errors or other potential issues that may impact the creation or the eventual execution of the object code. For instance, a compiler typically produces warnings or errors to alert an end user when portions of the source code violate the rules of a programming language.
Unfortunately, high-level object-oriented languages often have non-trivial rules that can lead to difficult-to-understand diagnostic messages. In such a programming environment, even a simple error in the source code may generate expansive, complex diagnostic messages that often mask the actual problem and can easily confuse an end user.
Furthermore, a compiler may be invoked in a range of programming environments. For instance, a compiler may sometimes be invoked from a command line, from within an integrated development environment (IDE), or by an automated build manager. A diagnostic message and format targeted for one environment may be unwieldy or confusing in another environment. For instance, a large block of diagnostic text may be unclear to a programmer who is using a graphical IDE that abstracts away some aspects of the programming language and environment. Similarly, diagnostic output suitable for a graphical IDE may be difficult to represent and/or display in a programming environment that involves command-line compilation of source code.
Hence, what is needed are techniques for producing diagnostic messages without the above-described problems of existing techniques.